package com.touni.designpattern.commandpattern;

/**
 * @ClassName : CommandDemo
 * @Description :
 *      数据驱动的设计模式，它属于行为型模式。请求以命令的形式包裹在对象中，并传给调用对象。
 *      调用对象寻找可以处理该命令的合适的对象，并把该命令传给相应的对象，该对象执行命令。
 *
 *
 * @Author : lwq
 * @Date: 2020-11-21 09:52
 */
public class CommandDemo {

    public static void main(String[] args) {
        BuyOrder buyOrder = new BuyOrder(new Request());
        SellOrder sellOrder = new SellOrder(new Request());
        Orders orders = new Orders();
        orders.addOrder(buyOrder);
        orders.addOrder(sellOrder);
        orders.takeOrder();
    }
}
